<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Dynamic Keyword Replacement Example</title>

	<!-- jQuery is required -->
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
	<script src="jquery.dki.js"></script>
	<script>
	// key/value pairs for dynamic replacement... if KEY in url param, the VALUE is replaced into element
	var group1 = { "free": '<span style="color: blue;">Free Trial!</span>', "trial": '<span style="color: magenta;">Try it out today!</span>' };
	var group2 = { "more": '<span style="color:red;">Get yours FREE!</span>', "guarantee": '<span style="color: green;">Money back guarantee!</span>' };
	var group3 = { "discount": '<span style="color: magenta;">50% off Sale!</span>', "cheap": '<span style="color: orange;">Best Deals in Town!</span>' };
	var gimage = { "images": 'http://www.catgifpage.com/gifs/226.gif' };
	//overwrites are awesome. This method works if you can't directly edit an element's attributes
	var dki = { 0: {"elem": "#h-three", "trigger": "kw2", "group": "group3"},
				1: {"elem": ".h-four", "trigger": "kw1", "group": "group3"},
				2: {"elem": "img", "trigger": "kw", "group": "gimage" } };
	</script>
</head>
<body>
	<p>[ <a href="http://local.nlk/_CODE_SNIPS/dynamic-keyword-insertion/dki-demo.html">default</a>, <a href="http://local.nlk/_CODE_SNIPS/dynamic-keyword-insertion/dki-demo.html?kw1=free%20discount">example 1</a>, <a href="http://local.nlk/_CODE_SNIPS/dynamic-keyword-insertion/dki-demo.html?kw2=guarantee%20cheap">example 2</a>, <a href="http://local.nlk/_CODE_SNIPS/dynamic-keyword-insertion/dki-demo.html?kw=images&amp;kw1=trial&amp;kw2=cheap">example 3 (img)</a> ]</p>
	<h1 class="dki" dkiGroup="group1" dkiTrigger="kw1">This is the default H1 Value</h1>
	<h2 class="dki" dkiGroup="group2" dkiTrigger="kw2">And this fella is the H2 default</h2>
	<h3 id="h-three">This is an H3 without DKI class</h3>
	<h4 class="h-four">Here is an H4 with no ID</h4>
	<img src="http://1-ps.googleusercontent.com/h/www.catgifpage.com/gifs/244_.gif.pagespeed.ce.S-XJ__rWZJ.gif" />
</body>
</html>